﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace KeyCore.Loans.Client.Web.Models.LoansClient
{
    [Serializable]
    public class LoansClientRegisterWizardModel
    {
        public int CurrentStepIndex { get; set; }
        public IList<ILoansClientWizardStep> Steps { get; set; }

        public void Initialize()
        {
            Steps = typeof(ILoansClientWizardStep)
                .Assembly
                .GetTypes()
                .Where(t => !t.IsAbstract && typeof(ILoansClientWizardStep).IsAssignableFrom(t))
                .Select(t => (ILoansClientWizardStep)Activator.CreateInstance(t))
                .ToList();

            // porzadkowanie steps na podstawie stepindex
            Steps = Steps.OrderBy(o => o.StepIndex).ToList();
        }

        //public LoansClientBasicDataModel BasicData { get; set; }
        //public LoansClientPersonalDataModel PersonalData { get; set; }
    }
}